package com.white.controller;

import com.white.bean.Report;
import com.white.mapper.ReportMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ReportController {
    @Autowired
    ReportMapper reportMapper;
    @GetMapping("/report/{reportUserId}")
    public void report(@CookieValue(UserController.LOGIN_USER_ID) Long userId,
                       @PathVariable("reportUserId") Long reportUserId) {
        Report report = new Report(userId, reportUserId);
        reportMapper.create(report);
    }
}
